package com.struts.service;

import com.struts.vo.UserinfoVO;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2015/2/9.
 */
public class JudgeServiceImpl implements JudgeService {
    @Override
    public Map<String, UserinfoVO> getVO(String user) {

        String url="";
        UserinfoVO userinfoVO = new UserinfoVO();
        Map<String,UserinfoVO> map = new HashMap<String, UserinfoVO>();
        boolean b = this.isUserinfo(user);
        if (b){

            userinfoVO.setU_name("success");
            userinfoVO.setU_pass("success");
            userinfoVO.setU_age("1");
            map.put("/view/view.jsp",userinfoVO);
           // url="/view/view.jsp";
        }else {
            userinfoVO.setU_name("error");
            userinfoVO.setU_pass("error");
            userinfoVO.setU_age("0");
            map.put("/view/error.jsp",userinfoVO);
            // request.setAttribute("meg","error");
           // url="/view/error.jsp";
        }
        return map;
    }

    private  boolean isUserinfo(String userinfo){

        boolean b =false;

        if(userinfo.equals("lxd")){

            b = true;
        }
        return b;
    }
}
